﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Engine.Classes {
    import flash.display.*;
    import flash.geom.*;

    public class ColorMaskedBitmap extends AnimatedBitmap {

        private var m_color:uint = 0xFF00FF;
        private var m_colorMask:BitmapData;
        private var m_colorTransform:ColorTransform;

        public function ColorMaskedBitmap(_arg1:BitmapData, _arg2:BitmapData, _arg3:int, _arg4:int, _arg5:int, _arg6:Number, _arg7:uint=0xFFFFFF){
            this.m_colorTransform = new ColorTransform();
            this.m_colorMask = _arg1;
            this.m_color = _arg7;
            if (_arg3 == 0){
                _arg4 = _arg2.width;
                _arg5 = _arg2.height;
            };
            this.updateTransform();
            super(_arg2, _arg3, _arg4, _arg5, _arg6);
        }
        protected function updateTransform():void{
            var _local1:uint = (this.m_color >> 16);
            var _local2:uint = ((this.m_color >> 8) & 0xFF);
            var _local3:uint = (this.m_color & 0xFF);
            this.m_colorTransform.redMultiplier = (_local1 / 0xFF);
            this.m_colorTransform.greenMultiplier = (_local2 / 0xFF);
            this.m_colorTransform.blueMultiplier = (_local3 / 0xFF);
        }
        public function set color(_arg1:uint):void{
            this.m_color = _arg1;
            this.updateTransform();
            this.draw();
        }
        override protected function draw():void{
            super.draw();
            m_targetBitmapData.draw(this.m_colorMask, null, this.m_colorTransform);
        }

    }
}//package Engine.Classes 
